package com.zy.composeworld.base.ext

import android.app.Activity
import android.content.Intent
import androidx.fragment.app.Fragment
import com.zy.composeworld.base.MainContainerActivity

fun Activity.startFragmentWithMainContainer(fragmentClass: Class<out Fragment>) {
    MainContainerActivity.start(this, fragmentClass)
}

fun Fragment.startFragmentWithMainContainer(fragmentClass: Class<out Fragment>?) {
    fragmentClass ?: return
    MainContainerActivity.start(requireContext(), fragmentClass)
}

fun Activity.startAT(classS: Class<out Activity>) {
    startActivity(Intent(this, classS))
}

fun Fragment.startAT(classS: Class<out Activity>) {
    startActivity(Intent(requireContext(), classS))
}